package cn.opopopo.design_pattern_learn.结构型.bridge;

public class BridgePatternDemo {
    public static void main(String[] args) {
        // 创建设备
        Device tv = new TV();
        Device radio = new Radio();

        // 普通遥控器控制 TV
        RemoteControl tvRemote = new RemoteControl(tv) {};
        tvRemote.turnOn();
        tvRemote.volumeUp();
        tvRemote.channelUp();
        tvRemote.turnOff();

        System.out.println("----------------------------");

        // 高级遥控器控制收音机
        AdvancedRemote radioRemote = new AdvancedRemote(radio);
        radioRemote.turnOn();
        radioRemote.volumeDown();
        radioRemote.mute();
        radioRemote.displayStatus();
        radioRemote.turnOff();
    }
}